﻿using System;
using Trust.Casas.Model;
using Se.Framework.Common;
using Se.Framework.Common.Data;

namespace Trust.Casas.Model
{
    public class DbContextUnitOfWork : IUnitOfWork
    {
        private readonly Lazy<TrustContext> context =
            new Lazy<TrustContext>(ObjectRegistry.Current.Resolve<TrustContext>);

        public DbContextUnitOfWork()
        {
        }

        public void Commit()
        {
            context.Value.SaveChanges();
        }

        public void Rollback()
        {
        }
    }
}